package edu.yuhf.web.listener;

import javax.servlet.annotation.WebListener;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpSessionAttributeListener;
import javax.servlet.http.HttpSessionBindingEvent;


@WebListener
public class SessionStatusListener implements HttpSessionAttributeListener {

	@Override
	public void attributeAdded(HttpSessionBindingEvent event) {
	}

	@Override
	public void attributeRemoved(HttpSessionBindingEvent event) {
    	HttpSession session = event.getSession();
    	System.out.println(session.getAttribute("name")+",有人使用你的帐号登录，你被踢下线了。");
	}

	@Override
	public void attributeReplaced(HttpSessionBindingEvent event) {
	}
}
